home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / utils / bibclean / Makefile < prev    next >
Makefile  |  1992-11-23  |  22KB  |  616 lines

  1. #=======================================================================
  2. # Makefile for BibTeX .bib file prettyprinter
  3. #
  4. # Current target list: (these include all GNU Project standard targets)
  5. #    all            build bibclean
  6. #    bclproto        obsolete; build an early prototype of bibclean
  7. #    bibclean        executable for bibclean
  8. #    bibclean.h        documentation strings for help() function
  9. #    bibclean.hlp        VAX VMS help file (automatically converted
  10. #                from bibclean.txt)
  11. #    bibclean.i        C preprocessor output from bibclean.c
  12. #    bibclean.ps        PostScript version of bibclean.man
  13. #    bibclean.shr        shar bundle for email distribution
  14. #    bibclean.tar        tar archive file for ftp distribution
  15. #    bibclean.txt        nroff'ed bibclean.man manual page file
  16. #    bibclean.zip        Info-zip archive file for ftp distribution
  17. #    bibclean.zoo        zoo archive file for ftp distribution
  18. #    check            same as test (see below)
  19. #    clean            clean up all but executables and time stamps
  20. #    clobber            clean up everything
  21. #    distclean        same as clobber
  22. #    docs            make bibclean.txt, bibclean.hlp, and bibclean.ps
  23. #    install            install executable and man pages
  24. #    install.time        internal target for install
  25. #    install-ftp        install .tar, .zip, and .zoo files in ftp tree
  26. #    install-ftp.time    internal target for install-ftp
  27. #    mostlyclean        same as clean
  28. #    realclean        bad grammar for reallyclean
  29. #    reallyclean        clobber, and remove TAGS file
  30. #    TAGS            GNU Emacs tags file
  31. #    test            test bibclean on BibTeX and Scribe
  32. #                bibliographies
  33. #    test-bibtex        test 1,2,3 bibclean on BibTeX bibliographies
  34. #    test-bibtex-1        test 1 bibclean on BibTeX bibliographies
  35. #    test-bibtex-2        test 2 bibclean on BibTeX bibliographies
  36. #    test-bibtex-3        test 3 ISBN and ISSN verification
  37. #    test-scribe        test 1,2,3 bibclean on Scribe bibliographies
  38. #    test-scribe-1        test 1 bibclean on Scribe bibliographies
  39. #    test-scribe-2        test 2 bibclean on Scribe bibliographies
  40. #    test-scribe-3        test 3 bibclean on Scribe bibliographies
  41. #    test-version        test extraction of version number
  42. #    uninstall        remove files installed by "make install"
  43. #    uninstall-ftp        remove installed files in anonymous ftp
  44. #                directory
  45. #    vaxvms/bibclean.uue    uuencoded version of VAX VMS bibclean.exe
  46. #                for portable distribution
  47. #
  48. # [24-Nov-1992]
  49. #=======================================================================
  50.  
  51. # Change these two directories to match local conventions:
  52. BINDIR        = /usr/local/bin
  53. MANDIR        = /usr/local/man/man1
  54. MANEXT        = 1
  55. FTPDIR        = /usr/spool/ftp/pub/tex/bib
  56.  
  57. # Need new awk (nawk) or gawk here:
  58. AWK        = nawk
  59.  
  60. # For testing purposes, make sure we always have the same
  61. # initialization file
  62. BIBCLEAN    = ./bibclean -init-file bibclean.ini
  63.  
  64. BIBTEX        = bibtex
  65.  
  66. BIBTEX-TESTS    = testbib1.org testbib2.org testisxn.org
  67.  
  68. # Use lcc or gcc with extra flags for extensive error checking, or use
  69. # C++ compiler (g++ or CC).  DO NOT CHANGE ANY OF THESE VALUES:
  70. # instead, copy one of these to the end of the CC list to select your
  71. # compiler.  You may also set the DEFINES value below too, though that
  72. # is rarely necessary.
  73.  
  74. CC    = CC            ## C++ for BSD 4.3 UNIX on HP 370
  75. CC    = CC +a1 -xansi +w    ## C++ for SGI IRIX 4.0 (see LOADLIBES below)
  76. CC    = cc -ansiposix -fullwarn -woff 22,24,183,205,262,269,302,303
  77.                                 ## C for SGI IRIX 4.0
  78. CC    = CC +a1 +p +w -D_POSIX_SOURCE -Hansi -D__STDC__ -D_BSD -D_AIX -Dps2 \
  79.       -DHAVE_TERMIO_H
  80.                                 ## C++ on AIX 370 and PS/2: +a1 (ANSI
  81.                                 ## declarations), +p (no anachronisms), +w
  82.                                 ## (warnings) -D-BSD (to get toupper() and
  83.                                 ## tolower() declared in ctype.h).
  84.                                 ## Need -DHAVE_TERMIO_H because termios.h
  85.                                 ## has wrong prototypes for C++
  86. CC    = CC +a1 +p +w -D_POSIX_SOURCE -Hansi -D__STDC__ -D_BSD -D_AIX -D_AIX370
  87.                                 ## C++ on AIX 370
  88. CC    = /usr/CC/sun4/CC -I/usr/CC/incl -D__SUNCC__ ## C++ on SunOS 4.1.1
  89. CC    = acc -Xc -vc -strconst -D__ACC__ -D_POSIX_SOURCE -DHAVE_TERMIOS_H
  90.                                 ## SunOS Standard C compiler (neither
  91.                                 ## -DHAVE_SGTTY_H nor -DHAVE_TERMIO_H gives
  92.                                 ## char-at-a-time input, sigh...; they work
  93.                                 ## fine on other systems).
  94. CC    = c89 -D_POSIX_SOURCE -D_ALL_SOURCE    ## IBM RS/6000
  95. CC    = c89 -D_HPUX_SOURCE    ## HP 9000/8xx HP-UX A.08
  96. CC    = cc            ## most systems
  97. CC    = cc            ## Stardent (NB: remove -g in OPT below)
  98. CC    = cc -systype bsd43 -D__CC__    ## MIPS RCxxxx RISCos 4.52 and 5.2:
  99. CC    = cc $(GCCFLAGS)    ## NeXT (cc is really GNU C compiler)
  100. CC    = g++ $(GCCFLAGS)    ## GNU C++
  101. CC    = lcc -A -A -n        ## Princeton/AT&T Standard C compiler
  102. CC    = gcc $(GCCFLAGS)    ## GNU C
  103.  
  104. # Compiler for this site:
  105. CC    = g++ $(GCCFLAGS)    ## GNU C++
  106.  
  107. # When HOST, USER, __DATE__, and __TIME__ are available,
  108. # bibclean preserves them for its version output
  109. CFLAGS        = $(OPT) $(DEFINES) -DHOST=\"$(HOST)\" -DUSER=\"$(USER)\"
  110.  
  111. CHMOD        = chmod
  112.  
  113. COMPRESS    = compress
  114.  
  115. # Use the -p flag where available to preserve file time stamps
  116. CP        = /bin/cp -p
  117. CP        = /bin/cp
  118.  
  119. # To select the value checking algorithms, you can define one of:
  120. #
  121. # HAVE_RECOMP        when re_comp() and re_exec() are available.
  122. # HAVE_REGEXP        when compile() and step() are available.
  123. # HAVE_PATTERNS        for internal pattern matching code (default)
  124. # HAVE_OLDCODE        for old hard-wired value checking
  125. #
  126. # If you experience problems with compiling the terminal handling code,
  127. # used for a `more' display of help, define one of:
  128. #
  129. # HAVE_SGTTY_H        for Berkeley style
  130. # HAVE_TERMIO_H        for SVID2 and XPG2 style
  131. # HAVE_TERMIOS_H    for XPG3, POSIX.1, FIPS 151-1 style
  132. # SCREEN_LINES=0    to suppress all terminal handling
  133. #
  134. # Finally, you can customize file names and search paths:
  135. # INITFILE=xxx        to change the name of the initialization file
  136. #            from .bibcleanrc.
  137. # SYSPATH=xxx        to change the system search path name from PATH
  138. # USERPATH=xxx        to change the user search path name from BIBINPUTS
  139. #
  140. # For most machines, the internal settings of these values are
  141. # adequate, and they need not be set here.  See however the setting of
  142. # HAVE_TERMIO_H for the IBM 3090 above.  On Sun systems, all 3 terminal
  143. # handling mechanisms are supported.  However, on SunOS 4.1.2 at
  144. # least, termios.h has incorrect function prototypes that prevent
  145. # successful compilation with C++ compilers; gcc will work in such a case.
  146.  
  147. DEFINES        = -DHAVE_REGEXP        ## SGI Irix 4.0, HP-UX
  148.  
  149. DEFINES        = -DHAVE_RECOMP        ## IBM AIX PS/2, IBM AIX 370,
  150.                                         ## NeXT, SunOS, ULTRIX
  151.  
  152. DEFINES        = -DHAVE_PATTERNS    ## generic solution for all systems
  153.  
  154. DIST-FILES    = README Makefile bibclean.c bibclean.h bibclean.hlp  \
  155.         bibclean.ini bibclean.man bibclean.ps bibclean.reg \
  156.         bibclean.txt fndfil.c machdefs.h match.c match.h os.h \
  157.         osatari.h ospcdos.h osprimos.h osrmx.h ostops20.h \
  158.         osunix.h osvaxvms.h osvmcms.h rofvms.awk strtol.c \
  159.         unixlib.h vaxvms.c vmswild.c xctype.h xerrno.h xpwd.h \
  160.         xstat.h xstddef.h xstdlib.h xstring.h xtypes.h \
  161.         $(BIBTEX-TESTS) \
  162.         $(BIBTEX-TESTS:.org=.bok) \
  163.         $(BIBTEX-TESTS:.org=.eok) \
  164.         testbib2.ltx \
  165.         $(SCRIBE-TESTS) \
  166.         $(SCRIBE-TESTS:.org=.bok) \
  167.         $(SCRIBE-TESTS:.org=.eok) \
  168.         testscr2.bo2 testscr2.eo2 \
  169.         ibmpc/bibclean.uue ibmpc/ibmtest.bat \
  170.         ibmpc/makefile.msc ibmpc/makefile.tcc \
  171.         ibmpc/msc51bld.bat ibmpc/msc51pth.bat \
  172.         ibmpc/msc60bld.bat ibmpc/msc60pth.bat \
  173.         ibmpc/msc70bld.bat ibmpc/msc70pth.bat \
  174.         ibmpc/tcc20bld.bat ibmpc/tcc20pth.bat \
  175.         ibmpc/tcc30bld.bat ibmpc/tcc30pth.bat \
  176.         vaxvms/bibclean.uue vaxvms/recomp.com \
  177.         vaxvms/vmsclean.com vaxvms/vmsmake.com \
  178.         vaxvms/vmstest.com
  179.  
  180. DIST-FILES-BIN    = ibmpc/bibclean.exe vaxvms/bibclean.exe
  181.  
  182. DITROFF        = ditroff    ## AT&T
  183. DITROFF        = groff        ## GNU
  184.  
  185. # Extra flags for gcc and g++ to get maximal checking
  186. GCCFLAGS    = -Wall -Wshadow -Wcast-qual -Wpointer-arith \
  187.           -Wwrite-strings
  188.  
  189. # Some systems define HOST or HOSTNAME, but others don't, so we
  190. # generate it at compile time with the hostname utility.
  191. HOST        = `hostname`
  192.  
  193. LATEX        = latex
  194.  
  195. LN        = ln -s
  196.  
  197. # Define this symbol for additional link libraries
  198. LOADLIBES    = -lC -lc_s        ## SGI IRIX 4.0 for shared libraries
  199. LOADLIBES    =
  200.  
  201. NROFF        = nroff
  202.  
  203. OPT        = -g
  204.  
  205. RM        = /bin/rm -f
  206.  
  207. SCRIBE-TESTS-1    = testscr1.org testscr2.org
  208.  
  209. # Do NOT use SCRIBE-TESTS-1 in this list, because MIPS 6280 RISCos 5.0
  210. # make then fails to correctly expand $(SCRIBE-TESTS:.org=.xyz).
  211. SCRIBE-TESTS    = testscr1.org testscr2.org testscr3.org
  212.  
  213. SED        = /bin/sed
  214.  
  215. SHELL        = /bin/sh
  216.  
  217. STRIP        = strip
  218.  
  219. TAGS-FILES    = bibclean.c match.c match.h
  220.  
  221. UNZIP        = unzip
  222.  
  223. VERSION        = `$(AWK) '/^[ \t]*version *= *"[0-9.]+", *$$/ \
  224.         { gsub(/[^0-9.]/,"",$$3); print $$3 }' bibclean.c`
  225.  
  226. ZIP        = zip
  227.  
  228. ZOO        = zoo
  229.  
  230. #=======================================================================
  231.  
  232. .SUFFIXES:
  233.  
  234. .SUFFIXES: .o .i .c .bib-new .bib-old .bib
  235.  
  236. .bib.bib-new:
  237.     -$(BIBCLEAN) <$< >$@
  238.  
  239. .bib.bib-old:
  240.     ./bclproto <$< >$@
  241.  
  242. .c.i:
  243.     $(CC) $(CFLAGS) -E $< 2>&1 | grep -v '^[     ]*$$' >$@
  244.  
  245. #=======================================================================
  246.  
  247. all:    bibclean test docs
  248.  
  249. # Original (and now very obsolete) ad hoc prototype
  250. bclproto:    bclproto.o
  251.     $(CC) $(CFLAGS) -o bclproto bclproto.o
  252.  
  253. bclproto.o:    bclproto.c os.h xerrno.h xstddef.h xstdlib.h xstring.h \
  254.         xtypes.h
  255.  
  256. # New grammar-based program.  Although strtol() is a Standard C
  257. # function, it is missing in older systems, including BSD 4.3,
  258. # so we simply use our own version.
  259. bibclean:    bibclean.o fndfil.o match.o strtol.o
  260.     $(CC) $(CFLAGS) -o bibclean bibclean.o fndfil.o match.o \
  261.         strtol.o $(LOADLIBES)
  262.  
  263. # This target converts the option descriptions from the manual pages
  264. # to C code for inclusion in bibclean.c.  The first awk command
  265. # augments the bibclean.man file in a pipe with some small changes
  266. # after the .TH line (which sets page dimensions) to get longer
  267. # unhyphenated ragged-right lines without page headers, and reduces
  268. # the option description indentation.
  269. #
  270. # Here are the magic nroff incantations:
  271. #
  272. # .pl 100i    set page length to 100in
  273. # .nr LL 7.2i    set LL register (page width) to 7.2in
  274. # .nh        no hyphenation
  275. # .na        no right-adjusting
  276. #
  277. # That output feeds into nroff for formatting, col for removal of
  278. # underlining and escape sequences, expand for tab removal, sed to
  279. # backslash all quotes, and a final awk step to select the lines
  280. # between OPTIONS and ERROR headers for conversion to C code.
  281.  
  282. bibclean.h:    bibclean.man
  283.     -$(RM) $@
  284.     echo '/* WARNING: Do NOT edit this file.  It was created automatically'\
  285.         >$@
  286.     echo '   with the command "make bibclean.h" by '$$USER@`hostname` \
  287.         >>$@
  288.     echo '   in '$$PWD' on '`date`' */' >>$@
  289.     echo >>$@
  290.     $(AWK) '{ if ($$0 ~ /^.TH/) \
  291.         printf("%s\n.pl 100i\n.nr LL 7.2i\n.nh\n.na",$$0); \
  292.         else if ($$0 ~ /^.TP .*remove-OPT-prefixes.*/) \
  293.         print ".TP 1in"; \
  294.         else \
  295.             print $$0}' <bibclean.man | \
  296.     $(NROFF) -man | col -b | expand | $(SED) -e 's/"/\\"/g' | $(AWK) \
  297.         '/^OPTION/,/^ERROR/ {if ($$0 !~ /^[A-Z]/) \
  298.             printf("\t\"%s\\n\",\n",substr($$0,6))}' >>$@
  299.     echo '    (const char*)NULL,' >>$@
  300.  
  301. # VAX VMS help file format from bibclean.txt
  302. bibclean.hlp:    bibclean.txt rofvms.awk
  303.     $(AWK) -f rofvms.awk <bibclean.txt >bibclean.hlp
  304.  
  305. bibclean.i:    bibclean.c bibclean.h match.h os.h unixlib.h \
  306.         xctype.h xerrno.h xstddef.h xstdlib.h xstring.h \
  307.         xtypes.h Makefile
  308.  
  309. bibclean.o:    bibclean.c bibclean.h match.h os.h unixlib.h \
  310.         xctype.h xerrno.h xstat.h xstddef.h xstdlib.h \
  311.         xstring.h xtypes.h
  312.  
  313. bibclean.ps:    bibclean.man
  314.     $(DITROFF) -Tps -man $? >$@
  315.  
  316. bibclean.shr:    $(DIST-FILES)
  317.     shar -b -c -v $(DIST-FILES) >bibclean.shr
  318.  
  319. bibclean.tar:    $(DIST-FILES) $(DIST-FILES-BIN)
  320.     -$(RM) bibclean.tar bibclean.tar-lst
  321.     tar chf bibclean.tar $(DIST-FILES) $(DIST-FILES-BIN)
  322.     -mkdir bibclean-$(VERSION)
  323.     cd bibclean-$(VERSION); tar xf ../bibclean.tar
  324.     tar cf bibclean-$(VERSION).tar bibclean-$(VERSION)
  325.     -$(RM) -r bibclean-$(VERSION)
  326.     -$(RM) bibclean.tar
  327.     $(LN) bibclean-$(VERSION).tar bibclean.tar
  328.  
  329. bibclean.txt:    bibclean.man
  330.     $(NROFF) -man bibclean.man | col -b | expand >$@
  331.  
  332. bibclean.zip:    $(DIST-FILES) $(DIST-FILES-BIN)
  333.     -$(RM) bibclean*.zip
  334.     -$(RM) bibclean*.zip-lst
  335.     $(ZIP) bibclean-$(VERSION).zip $(DIST-FILES) $(DIST-FILES-BIN)
  336.     $(UNZIP) -v bibclean-$(VERSION).zip >bibclean-$(VERSION).zip-lst
  337.     $(LN) bibclean-$(VERSION).zip bibclean.zip
  338.  
  339. bibclean.zoo:    $(DIST-FILES) $(DIST-FILES-BIN)
  340.     -$(RM) bibclean*.zoo
  341.     -$(RM) bibclean*.zoo-lst
  342.     $(ZOO) a bibclean-$(VERSION).zoo $(DIST-FILES) $(DIST-FILES-BIN)
  343.     $(ZOO) v bibclean-$(VERSION).zoo >bibclean-$(VERSION).zoo-lst
  344.     $(LN) bibclean-$(VERSION).zoo bibclean.zoo
  345.  
  346. clean mostlyclean:
  347.     -$(RM) $(BIBTEX-TESTS:.org=.bib)
  348.     -$(RM) $(SCRIBE-TESTS:.org=.bib)
  349.     -$(RM) *.aux
  350.     -$(RM) *.bbl
  351.     -$(RM) *.blg
  352.     -$(RM) *.dvi
  353.     -$(RM) *.err
  354.     -$(RM) *.i
  355.     -$(RM) *.log
  356.     -$(RM) *.o
  357.     -$(RM) *~
  358.     -$(RM) \#*
  359.     -$(RM) bibclean.shr
  360.     -$(RM) bibclean.tar bibclean-?.??.tar
  361.     -$(RM) bibclean.tar-lst
  362.     -$(RM) bibclean.zip
  363.     -$(RM) bibclean.zip-lst
  364.     -$(RM) bibclean.zoo
  365.     -$(RM) bibclean.zoo-lst
  366.     -$(RM) core
  367.     -$(RM) testisxn.bib
  368.     -$(RM) testscr2.bi2 testscr2.er2
  369.  
  370. clobber distclean:    clean
  371.     -$(RM) bclproto bibclean
  372.     -$(RM) bibclean.hlp
  373.     -$(RM) bibclean.ps
  374.     -$(RM) bibclean.txt
  375.     -$(RM) install.time install-ftp.time
  376.  
  377. docs:    bibclean.txt bibclean.hlp bibclean.ps
  378.  
  379. fndfil.i:    fndfil.c machdefs.h os.h ospcdos.h osrmx.h osunix.h \
  380.         osvmcms.h osatari.h osprimos.h ostops20.h osvaxvms.h \
  381.         unixlib.h xctype.h xpwd.h xstdlib.h xstring.h Makefile
  382.  
  383. fndfil.o:    fndfil.c machdefs.h os.h ospcdos.h osrmx.h osunix.h \
  384.         osvmcms.h osatari.h osprimos.h ostops20.h osvaxvms.h \
  385.         unixlib.h xctype.h xpwd.h xstdlib.h xstring.h
  386.  
  387. install:    install.time
  388.  
  389. install.time:    bibclean bibclean.man
  390.     $(CP) bibclean $(BINDIR)/bibclean
  391.     -$(STRIP) $(BINDIR)/bibclean
  392.     $(CHMOD) 755 $(BINDIR)/bibclean
  393.     $(CP) bibclean.ini $(BINDIR)/.bibcleanrc
  394.     $(CP) bibclean.man $(MANDIR)/bibclean.$(MANEXT)
  395.     -$(RM) $(MANDIR)/../cat$(MANEXT)/bibclean.$(MANEXT)
  396.     $(CHMOD) 644 $(MANDIR)/bibclean.$(MANEXT)
  397.     touch install.time
  398.  
  399. install-ftp:    install-ftp.time
  400.  
  401. install-ftp.time:    bibclean.tar bibclean.zip bibclean.zoo
  402.     tar tvf bibclean-$(VERSION).tar >$(FTPDIR)/bibclean-$(VERSION).tar-lst
  403.     $(COMPRESS) <bibclean-$(VERSION).tar \
  404.         >$(FTPDIR)/bibclean-$(VERSION).tar.z
  405.     $(CP) bibclean-$(VERSION).zip $(FTPDIR)
  406.     $(CP) bibclean-$(VERSION).zip-lst $(FTPDIR)
  407.     $(CP) bibclean-$(VERSION).zoo $(FTPDIR)
  408.     $(CP) bibclean-$(VERSION).zoo-lst $(FTPDIR)
  409.     ls -l $(FTPDIR)/bibclean*
  410.     date >install-ftp.time
  411.  
  412. match.i:    match.c match.h os.h xctype.h xstdlib.h xstring.h Makefile
  413.  
  414. match.o:    match.c match.h os.h xctype.h xstdlib.h xstring.h
  415.  
  416. reallyclean realclean:    distclean
  417.     -$(RM) TAGS
  418.  
  419. TAGS:    Makefile $(TAGS-FILES)
  420.     etags $(TAGS-FILES)
  421.  
  422. test check:    test-bibtex test-scribe
  423.  
  424. # Test bibclean on Part 1 of the Reduce bibliography, testbib2.org.  The
  425. # output file, testbib2.bib, is compared against a correct output file,
  426. # testbib2.bok, from the author's site, and then the bibliography is
  427. # additionally tested by LaTeX and BibTeX.
  428.  
  429. test-bibtex:    bibclean test-bibtex-1 test-bibtex-2 test-bibtex-3
  430.  
  431. test-bibtex-1:    bibclean testbib1.org
  432.     @echo
  433.     @echo "==================== begin BibTeX test 1 ====================="
  434.     @echo
  435.     -@$(RM) testbib1.err testbib1.bib
  436.     @echo
  437.     -$(BIBCLEAN) testbib1.org >testbib1.bib 2>testbib1.err
  438.     @echo
  439.     @echo "There should be no differences found:"
  440.     @echo "diff testbib1.bok testbib1.bib"
  441.     -@if diff testbib1.bok testbib1.bib ; then $(RM) testbib1.bib ; fi
  442.     @echo
  443.     @echo "There should be no differences found:"
  444.     @echo "diff testbib1.eok testbib1.err"
  445.     -@if diff testbib1.eok testbib1.err ; then $(RM) testbib1.err ; fi
  446.     @echo
  447.     @echo "===================== end BibTeX test 1 ======================"
  448.     @echo
  449.  
  450. test-bibtex-2:    bibclean testbib2.org
  451.     @echo
  452.     @echo "==================== begin BibTeX test 2 ====================="
  453.     @echo
  454.     @-$(RM) testbib2.aux testbib2.bbl testbib2.bib testbib2.blg \
  455.         testbib2.dvi testbib2.log
  456.     @echo
  457.     -$(BIBCLEAN) -no-check-values testbib2.org >testbib2.bib 2>testbib2.err
  458.     @echo
  459.     @echo "There should be no differences found:"
  460.     -diff testbib2.bok testbib2.bib
  461.     @echo
  462.     @echo "There should be no differences found:"
  463.     @echo "diff testbib2.eok testbib2.err"
  464.     -@if diff testbib2.eok testbib2.err ; then $(RM) testbib2.err ; fi
  465.     @echo
  466.     $(LATEX) testbib2.ltx >/dev/null
  467.     @echo
  468.     @echo "Expect 6 BibTeX warnings:"
  469.     -$(BIBTEX) testbib2
  470.     @if cmp testbib2.bok testbib2.bib 2>/dev/null ; \
  471.         then $(RM) testbib2.bib ; fi
  472.     @echo
  473.     $(LATEX) testbib2.ltx >/dev/null
  474.     @echo
  475.     $(LATEX) testbib2.ltx
  476.     @echo
  477.     @echo "===================== end BibTeX test 2 ======================"
  478.     @echo
  479.  
  480. # Test bibclean verification of ISBN and ISSN values.  The test file,
  481. # testisxn.org, contains several hundred correct values, and also
  482. # several hundred erroneous values.  We therefore discard error and
  483. # warning messages, we ignore the return code, and we don't try to use
  484. # the output with LaTeX or BibTeX.
  485. test-bibtex-3:    bibclean testisxn.org
  486.     @echo
  487.     @echo "==================== begin BibTeX test 3 ====================="
  488.     @echo
  489.     -$(BIBCLEAN) testisxn.org >testisxn.bib 2>testisxn.err
  490.     @echo
  491.     @echo "There should be no differences found:"
  492.     @echo "diff testisxn.bok testisxn.bib"
  493.     -@if diff testisxn.bok testisxn.bib ; then $(RM) testisxn.bib ; fi
  494.     @echo
  495.     @echo "There should be no differences found:"
  496.     @echo "diff testisxn.eok testisxn.err"
  497.     -@if diff testisxn.eok testisxn.err ; then $(RM) testisxn.err ; fi
  498.     @echo
  499.     @echo "===================== end BibTeX test 3 ======================"
  500.     @echo
  501.  
  502. # Test bibclean on a collection of Scribe bibliographies containing
  503. # test cases to exhibit variations in Scribe bibliography syntax.
  504.  
  505. test-scribe:    bibclean test-scribe-1 test-scribe-2 test-scribe-3
  506.  
  507. # The peculiar step using tr to prepare the .aux files is needed to
  508. # overcome inconsistencies in the handling of backslashes by the IBM
  509. # RS/6000 shell.  The documented behavior in the SunOS 4.1.1 manual
  510. # pages is (emphasis mine):
  511. #     All characters enclosed between a pair of single quote marks
  512. #     (''), except a single quote, are quoted by the shell.  BACKSLASH
  513. #     HAS NO SPECIAL MEANING INSIDE A PAIR OF SINGLE QUOTES.  A single
  514. #     quote may be quoted inside a pair of double quote marks (for
  515. #     example, "'").
  516. # On SunOS, HP UX, IBM 3090 AIX, NeXT Mach, and SGI IRIX, the shells
  517. # csh, sh, bash, and ksh agree with this.  However, on IBM RS/6000
  518. # AIX 3.2, backslashes in single quotes are untouched by csh, but
  519. # expanded by sh and ksh.  This is clearly a bug, because the INFO
  520. # hypertext node on bsh/rsh says:
  521. #     All characters, except the enclosing single quotation marks, are
  522. #     taken literally, with any special meaning removed.
  523. #
  524. test-scribe-1:    bibclean $(SCRIBE-TESTS-1)
  525.     @echo
  526.     @echo "==================== begin Scribe test 1 ====================="
  527.     @echo
  528.     -@for f in $(SCRIBE-TESTS-1) ; \
  529.     do \
  530.         BASENAME=`basename $$f .org` ; \
  531.         echo ; \
  532.         echo "----------------------------------------------------" ; \
  533.         echo ; \
  534.         echo "$(BIBCLEAN) -scribe -no-check $$f >$$BASENAME.bib" ; \
  535.         $(BIBCLEAN) -scribe -no-check $$f >$$BASENAME.bib \
  536.             2>$$BASENAME.err; \
  537.         echo ; \
  538.         echo "There should be no differences found:" ; \
  539.         echo "diff $$BASENAME.bok $$BASENAME.bib" ; \
  540.         diff $$BASENAME.bok $$BASENAME.bib ; \
  541.         echo ; \
  542.         echo "There should be no differences found:" ; \
  543.         echo "diff $$BASENAME.eok $$BASENAME.err" ; \
  544.         if diff $$BASENAME.eok $$BASENAME.err ; \
  545.             then $(RM) $$BASENAME.err ; fi ; \
  546.         echo ; \
  547.         echo 'Bbibstyle{plain}NBcitation{*}NBbibdata{'$$BASENAME'}' | \
  548.             tr BN '\134\012' >$$BASENAME.aux ; \
  549.         if [ "$$BASENAME" = "testscr1" ] ; \
  550.             then echo "Expect 5 BibTeX warnings" ; fi ; \
  551.         if [ "$$BASENAME" = "testscr2" ] ; \
  552.             then echo "There should be no BibTeX warnings:" ; fi ; \
  553.         echo "$(BIBTEX) $$BASENAME" ; \
  554.         $(BIBTEX) $$BASENAME; \
  555.         if cmp $$BASENAME.bok $$BASENAME.bib 2>/dev/null ; \
  556.             then $(RM) $$BASENAME.bib ; fi ; \
  557.     done
  558.     @echo "===================== end Scribe test 1 ======================"
  559.     @echo
  560.  
  561. test-scribe-2:    bibclean testscr2.org
  562.     @echo
  563.     @echo "==================== begin Scribe test 2 ====================="
  564.     @echo
  565.     -$(BIBCLEAN) -scribe -file -no-check -no-par testscr2.org \
  566.         >testscr2.bi2 2>testscr2.er2
  567.     @echo
  568.     @echo "There should be no differences found:"
  569.     @echo "diff testscr2.bo2 testscr2.bi2"
  570.     -@if diff testscr2.bo2 testscr2.bi2 ; then $(RM) testscr2.bi2 ; fi
  571.     @echo
  572.     @echo "There should be no differences found:"
  573.     @echo "diff testscr2.eo2 testscr2.er2"
  574.     -@if diff testscr2.eo2 testscr2.er2 ; then $(RM) testscr2.er2 ; fi
  575.     @echo
  576.     @echo "===================== end Scribe test 2 ======================"
  577.     @echo
  578.  
  579. test-scribe-3:    bibclean testscr3.org
  580.     @echo
  581.     @echo "==================== begin Scribe test 3 ====================="
  582.     @echo
  583.     -$(BIBCLEAN) -scribe -no-check testscr3.org >testscr3.bib 2>testscr3.err
  584.     @echo
  585.     @echo "There should be no differences found:"
  586.     @echo "diff testscr3.bok testscr3.bib"
  587.     -@if diff testscr3.bok testscr3.bib ; then $(RM) testscr3.bib ; fi
  588.     @echo
  589.     @echo "There should be no differences found:"
  590.     @echo "diff testscr3.eok testscr3.err"
  591.     -@if diff testscr3.eok testscr3.err ; then $(RM) testscr3.err ; fi
  592.     @echo
  593.     @echo "===================== end Scribe test 3 ======================"
  594.     @echo
  595.  
  596. test-version:    Makefile
  597.     @echo "Version number is ""'"$(VERSION)"'"
  598.  
  599. uninstall:
  600.     -$(RM) $(BINDIR)/bibclean $(BINDIR)/.bibcleanrc \
  601.         $(MANDIR)/bibclean.$(MANEXT) \
  602.         $(MANDIR)/../cat$(MANEXT)/bibclean.$(MANEXT)
  603.     -$(RM) install.time
  604.  
  605. uninstall-ftp:
  606.     -$(RM) $(FTPDIR)/bibclean-$(VERSION).tar
  607.     -$(RM) $(FTPDIR)/bibclean-$(VERSION).tar-lst
  608.     -$(RM) $(FTPDIR)/bibclean-$(VERSION).zip
  609.     -$(RM) $(FTPDIR)/bibclean-$(VERSION).zip-lst
  610.     -$(RM) $(FTPDIR)/bibclean-$(VERSION).zoo
  611.     -$(RM) $(FTPDIR)/bibclean-$(VERSION).zoo-lst
  612.     -$(RM) install-ftp.time
  613.  
  614. vaxvms/bibclean.uue:    vaxvms/bibclean.exe
  615.     uuencode vaxvms/bibclean.exe bibclean.exe >vaxvms/bibclean.uue
  616.